Fix cc-mode local variable problem.
authorRob Browning <rlb@defaultvalue.org>
Thu, 5 Jul 2007 06:40:43 +0000 (23:40 -0700)
committerRob Browning <rlb@defaultvalue.org>
Thu, 5 Jul 2007 06:40:43 +0000 (23:40 -0700)
debian/changelog
debian/patches/fix-cc-mode-local-vars.diff [new file with mode: 0644]
debian/patches/series

index 81a9cb4340b7b99e4a7c1a8ed32687e3d3d9dc17..488caa66d2b441c2b3bcb80bfbc0af838e8883ba 100644 (file)
@@ -8,7 +8,11 @@ emacs22 (22.1+1-1) unstable; urgency=low
   * If allowed, create and remove non-flavor-specific
     /usr/local/share/emacs/site-lisp.
   
- -- Rob Browning <rlb@defaultvalue.org>  Wed, 04 Jul 2007 23:36:10 -0700
+  * Fix cc-mode local variable problem.  Thanks to Sven Joachim
+    <sven_joachim@web.de> for forwarding the upstream patch.
+    (closes: #428898) [rlb]
+
+ -- Rob Browning <rlb@defaultvalue.org>  Wed, 04 Jul 2007 23:38:56 -0700
 
 emacs22 (22.0.99+1-1) experimental; urgency=low
 
diff --git a/debian/patches/fix-cc-mode-local-vars.diff b/debian/patches/fix-cc-mode-local-vars.diff
new file mode 100644 (file)
index 0000000..8182108
--- /dev/null
@@ -0,0 +1,50 @@
+* A problem with cc-mode and file local variables has been fixed.
+  Patch: fix-cc-mode-local-vars.diff
+  Provided-by: Sven Joachim <sven_joachim@web.de>
+  Date: Wed, 20 Jun 2007 15:36:23 +0200
+  Added-by: Rob Browning <rlb@defaultvalue.org>
+  Status: appears to be incorporated upstream
+
+  Upstream changelog entry:
+
+  2007-06-18  Alan Mackenzie  <acm@muc.de>
+
+       * progmodes/cc-mode.el (c-remove-any-local-eval-or-mode-variables):
+       When removing lines, also remove the \n.  Correction of patch of
+       2007-04-21.
+
+Index: sid/lisp/progmodes/cc-mode.el
+===================================================================
+--- sid.orig/lisp/progmodes/cc-mode.el
++++ sid/lisp/progmodes/cc-mode.el
+@@ -790,7 +790,8 @@
+   ;; If the buffer specifies `mode' or `eval' in its File Local Variable list
+   ;; or on the first line, remove all occurrences.  See
+   ;; `c-postprocess-file-styles' for justification.  There is no need to save
+-  ;; point here, or even bother too much about the buffer contents.
++  ;; point here, or even bother too much about the buffer contents.  However,
++  ;; DON'T mess up the kill-ring.
+   ;;
+   ;; Most of the code here is derived from Emacs 21.3's `hack-local-variables'
+   ;; in files.el.
+@@ -819,8 +820,8 @@
+                     (regexp-quote suffix)
+                     "$")
+             nil t)
+-      (beginning-of-line)
+-      (delete-region (point) (progn (end-of-line) (point)))))
++      (forward-line 0)
++      (delete-region (point) (progn (forward-line) (point)))))
+     ;; Delete the first line, if we've got one, in case it contains a mode spec.
+     (unless (and lv-point
+@@ -828,7 +829,8 @@
+                       (forward-line 0)
+                       (bobp)))
+       (goto-char (point-min))
+-      (delete-region (point) (progn (end-of-line) (point))))))
++      (unless (eobp)
++      (delete-region (point) (progn (forward-line) (point)))))))
+ (defun c-postprocess-file-styles ()
+   "Function that post processes relevant file local variables in CC Mode.
index 43d4a613f882474556c046add4df03e0cc6b095f..4704909ada876a328c019102a7e5f0d2a12c5694 100644 (file)
@@ -3,6 +3,7 @@ debian-adjust-mail-from-addresses.diff
 handle-dfsg-split.diff
 misc-unseparated.diff
 fix-vc-path.diff
+fix-cc-mode-local-vars.diff
 require-movemail-use-liblockfile.diff
 avoid-fakemail-mail-loss.diff
 version-mention-debian.diff